# -*- coding: utf-8 -*-
# @Time: 2025/7/11 13:59
# @Author: foxhuty
# @File: crawling_yijiupi.py
import requests
from lxml import etree

headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Content-Type': 'application/json',
    'Origin': 'https://www.yijiupi.com',
    'Referer': 'https://www.yijiupi.com/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'UUID': '0a696d23ee5446c71fa46a79f15043c1',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36',
    'appCode': 'ShoppingMallPC',
    'sec-ch-ua': '"Not)A;Brand";v="8", "Chromium";v="138", "Google Chrome";v="138"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'token': '',
    'x-sign': 'd124ce5c045eb6fbf98b0177c9cf7a52e0b327fe',
    'x-sign-nonce': 'f63d627c_489d_47ea_b778_395cd093616f',
    'x-sign-timestamp': '1752213458',
    'x-sign-version': '1.0',
}

json_data = {
    'data': {
        'specialAreaId': '',
        'bannerPosition': 0,
        'pageId': '',
        'customizedModuleId': '',
    },
    'cityId': 402,
    'countyRegionId': '320116',
    'userClassId': 1,
    'userDisplayClass': 0,
    'addressId': '',
    'deviceType': 3,
}

response = requests.post('https://www.yijiupi.com/v58/Banner/List', headers=headers, json=json_data)
print(response.text)

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{"data":{"specialAreaId":"","bannerPosition":0,"pageId":"","customizedModuleId":""},"cityId":402,"countyRegionId":"320116","userClassId":1,"userDisplayClass":0,"addressId":"","deviceType":3}'
#response = requests.post('https://www.yijiupi.com/v58/Banner/List', headers=headers, data=data)

